/*
 * Copyright 2025 RestfulToolX Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.welson.restfultoolx.service;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.welson.restfultoolx.model.ApiInfo;

import java.util.List;

/**
 * Controller扫描器接口
 * 负责扫描项目中的Spring Boot Controller类和方法
 */
public interface ControllerScanner {
    
    /**
     * 扫描整个项目中的所有Controller
     * @param project 项目实例
     * @return API信息列表
     */
    List<ApiInfo> scanProject(Project project);
    
    /**
     * 扫描指定模块中的Controller
     * @param module 模块实例
     * @return API信息列表
     */
    List<ApiInfo> scanModule(Module module);
    
    /**
     * 刷新项目缓存
     * @param project 项目实例
     */
    void refreshCache(Project project);
    
    /**
     * 检查类是否为Controller
     * @param className 类的全限定名
     * @return 是否为Controller类
     */
    boolean isControllerClass(String className);
    
    /**
     * 获取扫描进度
     * @return 扫描进度百分比 (0-100)
     */
    int getScanProgress();
    
    /**
     * 取消当前扫描任务
     */
    void cancelScan();
}